<xsl:stylesheet version="1.0" 
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="date">

<xsl:output omit-xml-declaration="yes" />

<xsl:param name="IsBlogOwner" />
<xsl:param name="RelativeUrl" />

<xsl:template match="/">
	<div id="comments">
	
		<h3 class="comments_headers"><xsl:value-of select="count(rows/row)"/> response<xsl:if test="count(rows/row) != 1">s</xsl:if> so far &#8595;</h3>
		
		<ul id="comment_list">		
			<xsl:apply-templates select="rows/row"/>
		</ul>

		<p>&#160;</p>
	</div>	
</xsl:template>

<xsl:template match="row">
	<li class="comment">
		<p class="comment_meta">
			<xsl:variable name="publishedDate" select="date:parseDate(Created, 'yyyy-MM-dd HH:mm:ss')"/>
			<strong>
        <xsl:choose>
          <xsl:when test="CommentUrl != ''">
            <a>
              <xsl:attribute name="href">
                <xsl:if test="starts-with(CommentUrl, 'http') = false">
                  http://
                </xsl:if>
                <xsl:value-of select="CommentUrl" />
              </xsl:attribute>
              <xsl:value-of select="Title"/>
            </a>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="Title"/>
          </xsl:otherwise>
        </xsl:choose>
			</strong>
			&#160;
			<span class="comment_time">// <xsl:value-of select="date:format-date($publishedDate, 'EEEE, d MMM yyyy hh:mm')"/></span>
		</p>
		<div class="entry">
			<p>			
				<xsl:value-of select="Body" disable-output-escaping="yes" />
			</p>
		</div>
	</li>
</xsl:template>
  
</xsl:stylesheet>
